package com.ftg.learn.controller;

import com.ftg.learn.pojo.User;
import com.ftg.learn.service.UserSercice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {
    @Autowired
UserSercice us;

    @GetMapping("/login")
    public int login(String user_name, String user_password) {
        User list = us.login(user_name, user_password);
        if (list != null) {
            return 1;
        }else{
            return 0;
        }
    }
}